import request from '@/utils/request'

// 获取赠送优惠券列表
export function listMemberCoupons (query) {
    return request({
        url: '/store/promotion/coupon/memberCoupons',
        method: 'get',
        params: query
    })
}

// 新增会员优惠券
export function addMemberCoupons (data) {
    return request({
        url: '/store/promotion/coupon/memberCoupons',
        method: 'post',
        data: data
    })
}

// 作废  
export function voidCoupon (memberCouponId) {
    return request({
        url: '/store/promotion/coupon/memberCoupons/' + memberCouponId,
        method: 'put',
    })
}

// 新增优惠券
export function addGive (data) {
    return request({
        url: '/store/promotion/coupon',
        method: 'POST',
        data: data
    })
}

// 修改优惠券
export function updateGive (data) {
    return request({
        url: '/store/promotion/coupon',
        method: 'put',
        data: data
    })
}
